package com.zn.test;

/**
 * @author Li
 * @Date 2023/4/7 10:42
 */
public class Sum {
    public static void main(String[] args) {
        /**
         * 求1到100的偶数和
         * 1到100的奇数和
         */
        int sum = 0;
        int osum = 0;
        for (int i = 1;i<=100;i++){
            if (i%2==0){
                sum+=i;
            }else {
                osum+=i;
            }
        }
        System.out.println(sum);
        System.out.println(osum);
    }
}
